import 'package:flutter/material.dart';

class TextWidget extends StatelessWidget {
  const TextWidget({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(backgroundColor: Colors.blue, title: Text('这是一个Text组件演示')),
      body: Container(
        alignment: Alignment.center,
        child: Container(
          decoration: BoxDecoration(color: Colors.amber),
          width: 200,
          height: 200,
          padding: EdgeInsets.only(left: 10, top: 10),
          child: Text(
            '这是一个Text组件演示',
            style: TextStyle(
              color: Colors.purple,
              fontSize: 20,
              fontWeight: FontWeight.w500,
            ),
            maxLines: 1,
            overflow: TextOverflow.ellipsis,
          ),
        ),
      ),
    );
  }
}
